package database;

import java.sql.DriverManager;
import java.sql.SQLException;

public class DatabaseMysql extends Database{	


	private String hostname;
	private String username;
	private String password;
	private String name;

	
	public DatabaseMysql(String hostname, String username, String password, String name){
		this.hostname = hostname;
		this.username = username;
		this.password = password;
		this.name = name;
	}


	protected ConnectionDB getConnectionDB()
    throws SQLException{
		
        String url = "jdbc:mysql://"+hostname+"/"+name+"?autoReconnect=true";

		DriverManager.registerDriver(new org.gjt.mm.mysql.Driver());
        
		return new ConnectionDB(DriverManager.getConnection(url,username,password));
		
	}
	
	
}

